package com.supermarket.controller;

import com.supermarket.annotation.OperationLogAnnotation;
import com.supermarket.service.DashboardService;
import com.supermarket.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/dashboard")
@RequiredArgsConstructor
@Slf4j
@Api(tags = "工作台", description = "提供工作台相关的操作接口")  // 类级别的 Swagger 注解
public class DashboardController {

    private final DashboardService dashboardService;

    /**
     * 获取工作台数据
     */
    @GetMapping("/data")
    @ApiOperation(value = "获取工作台数据", notes = "获取工作台数据")
    @OperationLogAnnotation(operation = "获取工作台数据", operationType = "查询")
    public Result getDashboardData() {
        log.info("获取工作台数据");
        return Result.success(dashboardService.getDashboardData());
    }
} 